#ifndef POSITION_INFO_CPP
#define POSITION_INFO_CPP

#include "PositionInfo.h"

GME::Position::Pair 
GME::Position::strip_position (
  std::string position)
{
  // check if the string is even 5 characters long. If it isn't,
  // it wasn't meant to be valid

  if (position.size () < 5)
    return std::pair <unsigned int, unsigned int> (0-1,0-1);

  // take off the ends
  position.erase (0,1);
  position.erase (position.size() - 1,1);

  // search for the ',' character
  std::string::size_type find_pos = position.find (',');

  if (find_pos == std::string::npos)
    return std::pair <unsigned int, unsigned int> (0-1,0-1);

  // use the find_pos to get the position information (if valid)
  std::string x = position.substr (0,find_pos);
  std::string y = position.substr (find_pos+1);

  // return the pairized version
  return std::pair <unsigned int, unsigned int>
    ((unsigned int)atoi (x.c_str ()), (unsigned int)atoi (y.c_str ()));
}


#endif
